﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InteractiveWhiteboardManagement.Base.Common
{
    public static class ErrorValidationUtil
    {
        /// <summary>
        /// check the string（判断 字符串）
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static bool IsStringMissing(string value)
        {
            return String.IsNullOrEmpty(value) || value.Trim() == String.Empty;
        }

        /// <summary>
        /// check the int number（判断 整型）
        /// </summary>
        /// <param name="value"></param>
        /// <param name="min"></param>
        /// <param name="max"></param>
        /// <returns></returns>
        public static bool IsNumberInValidRange(int value, int min, int max)
        {
            return (value >= min) && (value <= max);
        }

        /// <summary>
        /// check the double number（判断 浮点型）
        /// </summary>
        /// <param name="value"></param>
        /// <param name="min"></param>
        /// <param name="max"></param>
        /// <returns></returns>
        public static bool IsNumberInValidRange(double value, double min, double max)
        {
            return (value >= min) && (value <= max);
        }
    }
}
